package com.pangu.bean;

import com.pangu.util.DeviceUtil;

import java.io.Serializable;

/**
 * 运行信息的封装<br>
 * <p/>
 * Created by cuijianhui_91
 */
public class DeviceConfig implements Serializable {

    // 版本
    private String version;
    // 版本号
    private int versionCode;
    // 固件
    private String firmware;
    // 固件对应的sdk版本
    private int sdkVersion;
    // 分辨率
    private String resolution;
    // 硬件架构 armeabi|armeabi-v7a
    private String abi;
    // 屏幕密度
    private String density;
    // 设备名 Nexus One
    private String model;
    // 设备id(手机本身参数IMEI)
    private String imei;
    // 卡id
    private String simId;
    // mac
    private String mac;
    // 用户的uuid
    private String userUuid;
    // 是否模拟器
    private boolean isEmulator;
    // 是不是miui系统
    private Boolean isMiuiSystem;
    // DES加密算法的秘钥
    private String desKey;
    private String androidId;

    /**
     * 同步方法,判断是不是miui系统
     *
     * @return
     */
    public synchronized boolean isMIUISystem() {
        if (isMiuiSystem == null) {
            isMiuiSystem = DeviceUtil.checkMIUISystem();
        }

        return isMiuiSystem;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public int getVersionCode() {
        return versionCode;
    }

    public void setVersionCode(int versionCode) {
        this.versionCode = versionCode;
    }

    public String getFirmware() {
        return firmware;
    }

    public void setFirmware(String firmware) {
        this.firmware = firmware;
    }

    public int getSdkVersion() {
        return sdkVersion;
    }

    public void setSdkVersion(int sdkVersion) {
        this.sdkVersion = sdkVersion;
    }

    public String getResolution() {
        return resolution;
    }

    public void setResolution(String resolution) {
        this.resolution = resolution;
    }

    public String getAbi() {
        return abi;
    }

    public void setAbi(String abi) {
        this.abi = abi;
    }

    public String getDensity() {
        return density;
    }

    public void setDensity(String density) {
        this.density = density;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public String getImei() {
        return imei;
    }

    public void setImei(String imei) {
        this.imei = imei;
    }

    public String getSimId() {
        return simId;
    }

    public void setSimId(String simId) {
        this.simId = simId;
    }

    public String getMac() {
        return mac;
    }

    public void setMac(String mac) {
        this.mac = mac;
    }

    public String getUserUuid() {
        return userUuid;
    }

    public void setUserUuid(String userUuid) {
        this.userUuid = userUuid;
    }

    public String getDesKey() {
        return desKey;
    }

    public void setDesKey(String desKey) {
        this.desKey = desKey;
    }

    public boolean isEmulator() {
        return isEmulator;
    }

    public void setEmulator(boolean isEmulator) {
        this.isEmulator = isEmulator;
    }

    public String getAndroidId() {
        return androidId;
    }

    public void setAndroidId(String androidId) {
        this.androidId = androidId;
    }

    @Override
    public String toString() {
        return "DeviceConfig{" +
                "version='" + version + '\'' +
                ", versionCode=" + versionCode +
                ", firmware='" + firmware + '\'' +
                ", sdkVersion=" + sdkVersion +
                ", resolution='" + resolution + '\'' +
                ", abi='" + abi + '\'' +
                ", density='" + density + '\'' +
                ", model='" + model + '\'' +
                ", imei='" + imei + '\'' +
                ", simId='" + simId + '\'' +
                ", mac='" + mac + '\'' +
                ", userUuid='" + userUuid + '\'' +
                ", isEmulator=" + isEmulator +
                ", isMiuiSystem=" + isMiuiSystem +
                ", desKey='" + desKey + '\'' +
                '}';
    }

}
